package br.com.bacabeleireiros.sysbeleza.service.impl;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import br.com.bacabeleireiros.sysbeleza.dao.IMarcaDAO;
import br.com.bacabeleireiros.sysbeleza.entity.Marca;
import br.com.bacabeleireiros.sysbeleza.service.IMarcaService;

@Service("marcaService")
public class MarcaServiceImpl implements IMarcaService, Serializable {

	private static final long serialVersionUID = 1L;
	
	@Autowired
	public IMarcaDAO dao;

	public MarcaServiceImpl() {
		
	}

	@Override
	@Transactional
	public Marca salva(Marca marca) {
		return dao.salva(marca);
	}

	@Override
	public List<Marca> getAll() {
		return dao.getAll();
	}

	@Override
	@Transactional
	public void exclui(Marca marca) {
		marca = dao.getById(Marca.class, marca.getIdMarca());
		dao.exclui(marca);
	}

}
